﻿using System.Data.Objects;
using System.Linq;
using Repository;

namespace DataGenerator.DefaultSets
{
    /// <summary>
    /// Generator emplementation
    /// </summary>
    public class EquipmentTypeSet : SetBase<EquipmentType>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EquipmentTypeSet"/> class.
        /// </summary>
        /// <param name="objectSet">The object set.</param>
        public EquipmentTypeSet(ObjectSet<EquipmentType> objectSet)
            : base(objectSet)
        {
        }

        public EquipmentType Projector
        {
            get { return Get(() => Projector); }
            set { Set(() => Projector, value); }
        }      
        
        public EquipmentType Board
        {
            get { return Get(() => Board); }
            set { Set(() => Board, value); }
        }     
   
        public EquipmentType Computer
        {
            get { return Get(() => Computer); }
            set { Set(() => Computer, value); }
        }       
        
        public EquipmentType Screen
        {
            get { return Get(() => Screen); }
            set { Set(() => Screen, value); }
        }

        public EquipmentType LaboratoryStand
        {
            get { return Get(() => LaboratoryStand); }
            set { Set(() => LaboratoryStand, value); }
        }

        /// <summary>
        /// Searches the default value.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>Default entity.</returns>
        protected override EquipmentType SearchDefaultValue(string name)
        {
            return ObjectSet.FirstOrDefault(e => e.Name == name);
        }
    }
}
